package me.mock.ingress;

import android.provider.Settings.Secure;
import de.robv.android.xposed.XC_MethodHook;

public class GetSecureSettingsHook extends XC_MethodHook
{
	public GetSecureSettingsHook()
	{
		super(PRIORITY_HIGHEST);
	}

	@Override
	protected void beforeHookedMethod(MethodHookParam param) throws Throwable
	{
		if (!Secure.ALLOW_MOCK_LOCATION.equals(param.args[1]))
			return;

		String method = param.method.getName();
		if (method.equals("getFloat") || method.equals("getInt") || method.equals("getLong"))
			param.setResult(0);
		else
			param.setResult("0");

		return;
	}
}
